﻿using RBACProject.Application.Menu.Dto;
using RBACProject.Domian;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace RBACProject.Application.Menu
{
    /// <summary>
    /// 角色服务层接口
    /// </summary>
    public interface IMenuService
    {
        /// <summary>
        /// 获取菜单子节点(递归)
        /// </summary>
        /// <param name="parentId"></param>
        /// <returns></returns>
        List<TreeDto> GetTreeInfo(int parentId);

        /// <summary>
        /// 获取菜单全部信息
        /// </summary>
        /// <returns></returns>
        ResultDto<List<TreeDto>> GetMenuInfo();

        /// <summary>
        /// 获取菜单类型枚举  （目录，菜单，按钮）
        /// </summary>
        /// <returns></returns>
        ResultDto<List<object>> GetMenuTypeInfo();


        /// <summary>
        /// 菜单添加
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
       Task<ResultDto<bool>> AddMeunInfo(CreateUpdateDto dto);

        /// <summary>
        /// 菜单逻辑删除
        /// </summary>
        /// <param name="id">主键id</param>
        /// <returns></returns>
        Task<ResultDto<int>> DeleteMenu(int id);

        /// <summary>
        /// 通过Id获取菜单一条数据
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<ResultDto<MenuModel>> GetMenuInfoById(int id);


        /// <summary>
        /// 菜单编辑
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        Task<ResultDto<MenuModel>> UpdateMenuInfo(MenuModel model);

        /// <summary>
        /// 根据登陆的用户角色获取可访问的菜单信息
        /// </summary>
        /// <returns></returns>
        ResultDto<List<MenuModel>> GetMenuRoute();

    }
}
